#!/usr/bin/python
# encoding: utf-8
'''
@File    :   code.py
@Time    :   2020/03/11 21:54:19
@Author  :   fangkaijin 
@Version :   1.0
@Contact :   fangkaijin@gmail.com
@License :   杭州移动互联
@Desc    :   None
'''

# 导入库包

import sys, os
import pickle
'''
使用pickle 序列化和反序列化
'''
os.chdir('/Users/fangkaijin/Downloads')
print(os.getcwd())
obj = ('小白', '学生', '96.5')
print(obj)
print(__doc__)
try:
    with open(r'pytest03.txt', mode='ab') as wf:
        pickle.dump(obj, wf)
    with open(r'pytest03.txt', mode='rb') as rf:
        data = pickle.load(rf)
        print(data)
except Exception as e:
    print('报错了 %s .' % (str(e)))